package com.csh.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName tb_goods
 */
@TableName(value ="tb_goods")
@Data
@Document(indexName = "tb_goods")
public class TbGoods implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    @Id
    private Integer id;

    /**
     * 商品名
     */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String goodsName;

    /**
     * 图片
     */
    @Field(type = FieldType.Keyword)
    private String goodsImage;

    /**
     * 价格
     */
    @Field(type = FieldType.Double)
    private Double price;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private Date creatTime;

    /**
     * 销售量
     */
    @Field(type = FieldType.Integer)
    private Integer goodsQuantity;

    /**
     * 点击率
     */
    @Field(type = FieldType.Integer)
    private Integer clickRate;


    private Integer goodsCommodity;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}